package com.huaxindata.im.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class ChatMessageBody implements Parcelable{
    protected ChatMessageBody(Parcel in) {
        type = in.readInt();
    }

    public static final Creator<ChatMessageBody> CREATOR = new Creator<ChatMessageBody>() {
        @Override
        public ChatMessageBody createFromParcel(Parcel in) {
            return new ChatMessageBody(in);
        }

        @Override
        public ChatMessageBody[] newArray(int size) {
            return new ChatMessageBody[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(type);
    }

    //消息类型 1个字节
    public static class Type {
        public static final int SYSTEM = 33;//系统消息--33

        public static final int TEXT = 0;//文本消息--0
        public static final int IMAGE = 1;//图片消息--1
        public static final int LOCATION   = 2;//位置消息--2
        public static final int VOICE      = 3;//声音消息--3
        public static final int VIDEO      = 4;//视频消息--4
        public static final int FILE       = 5;//文件消息--5
        //控制消息
        public static final int VOICE_CALL = 6;//语音呼叫--6
        //expand
        public static final int STATION    = 16;//发送站点--16
        public static final int SVG        = 17;//发送工艺图--17
        public static final int WARN       = 18;//发送告警--18
        public static final int WORKTASK   = 19;//发送工单--19
        public static final int TARGET     = 20;//发送指标--20
        public static final int NEWS       = 21;//发送新闻--21
    }

    public ChatMessageBody() {
    }

    public ChatMessageBody(int type) {
        this.type = type;
    }

    private int type;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "ChatMessageBody{" +
                "type=" + type +
                '}';
    }
}
